home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group94b.txt / 000118_icon-group-sender _Mon Nov 21 11:31:37 1994.msg < prev    next >
Internet Message Format  |  1995-02-09  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 21 Nov 1994 13:15:18 MST
  2. To: icon-group-l@cs.arizona.edu
  3. Date: 21 Nov 1994 11:31:37 -0700
  4. From: kline@cs.arizona.edu (Nick Kline)
  5. Message-Id: <3aqp29$do0@cheltenham.cs.arizona.edu>
  6. Organization: University of Arizona CS Department, Tucson AZ
  7. Sender: icon-group-request@cs.arizona.edu
  8. References: <3aofof$f5m@highway.leidenuniv.nl>, <3aonpq$4kp@caslon.cs.arizona.edu>
  9. Subject: Re: optional typing in Icon (longish)
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. In article <3aonpq$4kp@caslon.cs.arizona.edu>,
  13. Dave Schaumann <dave@CS.Arizona.EDU> wrote:
  14. >In article <3aofof$f5m@highway.leidenuniv.nl>,
  15. >Jan-Peter de Ruiter <ruiter@ruls41.LeidenUniv.nl> wrote:
  16. >[much deletia]
  17. >>o How much optimisation opportunities will arise from having
  18. >>  variables with a fixed type.
  19. >
  20. >For types that have primitive operations that can be implemented
  21. >in a few machine operations (few enough to be in-lined reasonably),
  22. >this can be a significant savings.  Not only do you get the benefit
  23. >of not having to go through the general case (which probably involves
  24. >a function call), but you also get the benefit of less stuff dynamically
  25. >allocated, so the garbage collecter has less work to do.
  26.  
  27. and also think how much this would complicate the runtime.  The run
  28. time is complex, but basically it has encapsulated types, and all the
  29. run time function take these as parameters.  It can take a pointer and
  30. see what type it is and decide whether to convert it to a string, or
  31. convert a string to an int and add another number to it or whatever.
  32.  
  33. If we could somehow figure out that certain things were only going to
  34. be used as ints (and it is sure possible), then we would need to have a much
  35. more complex runtime, which instead of simply passing ptrs to "objects" as
  36. parameters to icon internal routines, we'd need to special case all 
  37. that code in the case where we already knew things were ints.  
  38.  
  39. I think a better soln is to improve the icon compiler (which I know clint
  40. has one of his students working on).
  41.  
  42. -nick